img = imread("org.png");

f1 = 1/3 * [1 1 0; 1 0 -1; 0 -1 -1];
f3  = [0 -1 0; -1 5 -1; 0 -1 0];
f4  = [0 0 0; 0 1 0; 0 0 0];
f5 = [1 -2 1];


gray_img = rgb2gray(img);

conv_img1 = conv2(double(gray_img), f1, 'same');  % 对图像进行卷积
conv_img3 = conv2(double(gray_img), f3, 'same');
conv_img4 = conv2(double(gray_img), f4, 'same');
conv_img5 = conv2(double(gray_img), f5, 'same');

% 显示原始图像和卷积结果
subplot(1, 2, 1);
imshow(img);
title('original');

subplot(1, 2, 2);
imshow(conv_img5, []);
title('f3');